<div class="top_products_wrap">
    <h2>Кращі товари:</h2>   
    <?php foreach ($products as $key => $product) : ?>        
        <a href="#">      
            <img src="<?= $product['img']; ?>" />
            <br/>        
            <?= $key; ?>
        </a>
    <?php endforeach; ?>
</div>